<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
<head>
    <title>Jumper documentation</title>
    <link rel="stylesheet" href="../ldoc.css" type="text/css" />
</head>
<body>

<div id="container">

<div id="product">
	<div id="product_logo"></div>
	<div id="product_name"><big><b></b></big></div>
	<div id="product_description"></div>
</div> <!-- id="product" -->


<div id="main">


<!-- Menu -->

<div id="navigation">
<br/>
<h1>Jumper</h1>

<ul>
  <li><a href="../index.html">Index</a></li>
</ul>

<h2>Contents</h2>
<ul>
<li><a href="#Class_Grid_">Class Grid </a></li>
</ul>


<h2>Modules</h2>
<ul>
  <li><a href="../modules/core.bheap.html">core.bheap</a></li>
  <li><a href="../modules/core.heuristics.html">core.heuristics</a></li>
  <li><a href="../modules/core.node.html">core.node</a></li>
  <li><a href="../modules/core.path.html">core.path</a></li>
  <li><strong>grid</strong></li>
  <li><a href="../modules/pathfinder.html">pathfinder</a></li>
</ul>
<h2>Examples</h2>
<ul>
  <li><a href="../examples/annotatedpathing.lua.html">annotatedpathing.lua</a></li>
  <li><a href="../examples/customheuristics.lua.html">customheuristics.lua</a></li>
  <li><a href="../examples/makeclearance.lua.html">makeclearance.lua</a></li>
  <li><a href="../examples/simpleexample.lua.html">simpleexample.lua</a></li>
</ul>

</div>

<div id="content">

<h1>Module <code>grid</code></h1>

<p>The Grid class.</p>
<p> Implementation of the <a href="../modules/grid.html#">grid</a>  class.
 The <a href="../modules/grid.html#">grid</a>  is a implicit graph which represents the 2D
 world map layout on which the <a href="../modules/pathfinder.html#">pathfinder</a>  object will run.
 During a search, the <a href="../modules/pathfinder.html#">pathfinder</a>  object needs to save some critical values. These values are cached within each <code>node</code>
 object, and the whole set of nodes are tight inside the <a href="../modules/grid.html#">grid</a>  object itself.</p>

<h2><a href="#Class_Grid_">Class Grid </a></h2>
<table class="function_list">
	<tr>
	<td class="name" nowrap><a href="#Grid:new">Grid:new&nbsp;(map [, cacheNodeAtRuntime])</a></td>
	<td class="summary">Inits a new <a href="../modules/grid.html#">grid</a> </td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Grid:isWalkableAt">Grid:isWalkableAt&nbsp;(x, y [, walkable [, clearance]])</a></td>
	<td class="summary">Checks if <code>node</code> at [x,y] is <strong>walkable</strong>.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Grid:getWidth">Grid:getWidth&nbsp;()</a></td>
	<td class="summary">Returns the <a href="../modules/grid.html#">grid</a>  width.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Grid:getHeight">Grid:getHeight&nbsp;()</a></td>
	<td class="summary">Returns the <a href="../modules/grid.html#">grid</a>  height.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Grid:getMap">Grid:getMap&nbsp;()</a></td>
	<td class="summary">Returns the collision map.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Grid:getNodes">Grid:getNodes&nbsp;()</a></td>
	<td class="summary">Returns the set of nodes.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Grid:getBounds">Grid:getBounds&nbsp;()</a></td>
	<td class="summary">Returns the <a href="../modules/grid.html#">grid</a>  bounds.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Grid:getNeighbours">Grid:getNeighbours&nbsp;(node [, walkable [, allowDiagonal [, tunnel [, clearance]]]])</a></td>
	<td class="summary">Returns neighbours.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Grid:iter">Grid:iter&nbsp;( [lx [, ly [, ex [, ey]]]])</a></td>
	<td class="summary">Grid iterator.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Grid:around">Grid:around&nbsp;(node [, radius])</a></td>
	<td class="summary">Grid iterator.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Grid:each">Grid:each&nbsp;(f [, ...])</a></td>
	<td class="summary">Each transformation.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Grid:eachRange">Grid:eachRange&nbsp;(lx, ly, ex, ey, f [, ...])</a></td>
	<td class="summary">Each (in range) transformation.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Grid:imap">Grid:imap&nbsp;(f [, ...])</a></td>
	<td class="summary">Map transformation.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Grid:imapRange">Grid:imapRange&nbsp;(lx, ly, ex, ey, f [, ...])</a></td>
	<td class="summary">Map in range transformation.</td>
	</tr>
	<tr>
	<td class="name" nowrap><a href="#Grid:getNodeAt">Grid:getNodeAt&nbsp;(x, y)</a></td>
	<td class="summary">Returns the <code>node</code> at location [x,y].</td>
	</tr>
</table>

<br/>
<br/>


    <h2><a name="Class_Grid_"></a>Class Grid </h2>
    The <a href="../modules/grid.html#Class_Grid">Grid</a>  class.<br/>
 This class is callable.
 Therefore,_ <code>Grid(...)</code> <em>acts as a shortcut to</em> <code>Grid:new(...)</code>.
    <dl class="function">
    <dt>
    <a name = "Grid:new"></a>
    <strong>Grid:new&nbsp;(map [, cacheNodeAtRuntime])</strong>
    </dt>
    <dd>
    Inits a new <a href="../modules/grid.html#">grid</a>

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">map</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.5">table</a> or <a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a></span>
       A collision map - (2D array) with consecutive indices (starting at 0 or 1)
 or a <a href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a>  with line-break chars (<code>\n</code> or <code>\r</code>) as row delimiters.</li>
      <li><span class="parameter">cacheNodeAtRuntime</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">bool</a></span>
       When <strong>true</strong>, returns an empty <a href="../modules/grid.html#">grid</a>  instance, so that
 later on, indexing a non-cached <code>node</code> will cause it to be created and cache within the <a href="../modules/grid.html#">grid</a>  on purpose (i.e, when needed).
 This is a <strong>memory-safe</strong> option, in case your dealing with some tight memory constraints.
 Defaults to <strong>false</strong> when omitted.</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">
 -- A simple 3x3 grid
 local myGrid = Grid:new({{0,0,0},{0,0,0},{0,0,0}})

 -- A memory-safe 3x3 grid
 myGrid = Grid('000\n000\n000', true)</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/grid.html#">grid</a></span>
        a new <a href="../modules/grid.html#">grid</a>  instance
    </ol>


</dd>
    <dt>
    <a name = "Grid:isWalkableAt"></a>
    <strong>Grid:isWalkableAt&nbsp;(x, y [, walkable [, clearance]])</strong>
    </dt>
    <dd>
    Checks if <code>node</code> at [x,y] is <strong>walkable</strong>.
 Will check if <code>node</code> at location [x,y] both <em>exists</em> on the collision map and <em>is walkable</em>

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">x</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the x-location of the node</li>
      <li><span class="parameter">y</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the y-location of the node</li>
      <li><span class="parameter">walkable</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a>, <a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a> or <a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">func</a></span>
       the value for walkable locations in the collision map array (see <a href="../modules/grid.html#Grid:new">Grid:new</a>).
 Defaults to <strong>false</strong> when omitted.
 If this parameter is a function, it should be prototyped as <strong>f(value)</strong> and return a <a href="http://www.lua.org/manual/5.1/manual.html#2.2">boolean</a> :
 <strong>true</strong> when value matches a <strong>walkable</strong> <code>node</code>, <strong>false</strong> otherwise. If this parameter is not given
 while location [x,y] <strong>is valid</strong>, this actual function returns <strong>true</strong>.</li>
      <li><span class="parameter">clearance</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the amount of clearance needed. Defaults to 1 (normal clearance) when not given.</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">
 -- Always true
 print(myGrid:isWalkableAt(2,3))

 -- True if node at [2,3] collision map value is 0
 print(myGrid:isWalkableAt(2,3,0))

 -- True if node at [2,3] collision map value is 0 and has a clearance higher or equal to 2
 print(myGrid:isWalkableAt(2,3,0,2))
</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">bool</a></span>
        <strong>true</strong> if <code>node</code> exists and is <strong>walkable</strong>, <strong>false</strong> otherwise
    </ol>


</dd>
    <dt>
    <a name = "Grid:getWidth"></a>
    <strong>Grid:getWidth&nbsp;()</strong>
    </dt>
    <dd>
    Returns the <a href="../modules/grid.html#">grid</a>  width.


    <h3>Usage:</h3>
    <ul>
        <pre class="example">print(myGrid:getWidth())</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
        the <a href="../modules/grid.html#">grid</a>  width
    </ol>


</dd>
    <dt>
    <a name = "Grid:getHeight"></a>
    <strong>Grid:getHeight&nbsp;()</strong>
    </dt>
    <dd>
    Returns the <a href="../modules/grid.html#">grid</a>  height.


    <h3>Usage:</h3>
    <ul>
        <pre class="example">print(myGrid:getHeight())</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
        the <a href="../modules/grid.html#">grid</a>  height
    </ol>


</dd>
    <dt>
    <a name = "Grid:getMap"></a>
    <strong>Grid:getMap&nbsp;()</strong>
    </dt>
    <dd>
    Returns the collision map.


    <h3>Usage:</h3>
    <ul>
        <pre class="example">local map = myGrid:getMap()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><span class="type">map</span></span>
        the collision map (see <a href="../modules/grid.html#Grid:new">Grid:new</a>)
    </ol>


</dd>
    <dt>
    <a name = "Grid:getNodes"></a>
    <strong>Grid:getNodes&nbsp;()</strong>
    </dt>
    <dd>
    Returns the set of nodes.


    <h3>Usage:</h3>
    <ul>
        <pre class="example">local nodes = myGrid:getNodes()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><span class="type">{{node,...},...}</span></span>
        an array of nodes
    </ol>


</dd>
    <dt>
    <a name = "Grid:getBounds"></a>
    <strong>Grid:getBounds&nbsp;()</strong>
    </dt>
    <dd>
    Returns the <a href="../modules/grid.html#">grid</a>  bounds.  Returned values corresponds to the upper-left
 and lower-right coordinates (in tile units) of the actual <a href="../modules/grid.html#">grid</a>  instance.


    <h3>Usage:</h3>
    <ul>
        <pre class="example">local left_x, left_y, right_x, right_y = myGrid:getBounds()</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>
        <li>
          <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
        the upper-left corner x-coordinate</li>
        <li>
          <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
        the upper-left corner y-coordinate</li>
        <li>
          <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
        the lower-right corner x-coordinate</li>
        <li>
          <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
        the lower-right corner y-coordinate</li>
    </ol>


</dd>
    <dt>
    <a name = "Grid:getNeighbours"></a>
    <strong>Grid:getNeighbours&nbsp;(node [, walkable [, allowDiagonal [, tunnel [, clearance]]]])</strong>
    </dt>
    <dd>
    Returns neighbours.  The returned value is an array of <strong>walkable</strong> nodes neighbouring a given <code>node</code>.

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">node</span>
        <span class="types"><span class="type">node</span></span>
       a given <code>node</code></li>
      <li><span class="parameter">walkable</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#5.4">string</a>, <a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a> or <a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">func</a></span>
       the value for walkable locations in the collision map array (see <a href="../modules/grid.html#Grid:new">Grid:new</a>).
 Defaults to <strong>false</strong> when omitted.</li>
      <li><span class="parameter">allowDiagonal</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">bool</a></span>
       when <strong>true</strong>, allows adjacent nodes are included (8-neighbours).
 Defaults to <strong>false</strong> when omitted.</li>
      <li><span class="parameter">tunnel</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">bool</a></span>
       When <strong>true</strong>, allows the <a href="../modules/pathfinder.html#">pathfinder</a>  to tunnel through walls when heading diagonally.</li>
      <li><span class="parameter">clearance</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       When given, will prune for the neighbours set all nodes having a clearance value lower than the passed-in value
 Defaults to <strong>false</strong> when omitted.</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">
 local aNode = myGrid:getNodeAt(5,6)
 local neighbours = myGrid:getNeighbours(aNode, 0, true)</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><span class="type">{node,...}</span></span>
        an array of nodes neighbouring a given node
    </ol>


</dd>
    <dt>
    <a name = "Grid:iter"></a>
    <strong>Grid:iter&nbsp;( [lx [, ly [, ex [, ey]]]])</strong>
    </dt>
    <dd>
    Grid iterator.  Iterates on every single node
 in the <a href="../modules/grid.html#">grid</a> . Passing <strong>lx, ly, ex, ey</strong> arguments will iterate
 only on nodes inside the bounding-rectangle delimited by those given coordinates.

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">lx</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the leftmost x-coordinate of the rectangle. Default to the <a href="../modules/grid.html#">grid</a>  leftmost x-coordinate (see <a href="../modules/grid.html#Grid:getBounds">Grid:getBounds</a>).</li>
      <li><span class="parameter">ly</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the topmost y-coordinate of the rectangle. Default to the <a href="../modules/grid.html#">grid</a>  topmost y-coordinate (see <a href="../modules/grid.html#Grid:getBounds">Grid:getBounds</a>).</li>
      <li><span class="parameter">ex</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the rightmost x-coordinate of the rectangle. Default to the <a href="../modules/grid.html#">grid</a>  rightmost x-coordinate (see <a href="../modules/grid.html#Grid:getBounds">Grid:getBounds</a>).</li>
      <li><span class="parameter">ey</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the bottom-most y-coordinate of the rectangle. Default to the <a href="../modules/grid.html#">grid</a>  bottom-most y-coordinate (see <a href="../modules/grid.html#Grid:getBounds">Grid:getBounds</a>).</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">
 for node, count in myGrid:iter() do
   print(node:getX(), node:getY(), count)
 end</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>
        <li>
          <span class="types"><span class="type">node</span></span>
        a <code>node</code> on the collision map, upon each iteration step</li>
        <li>
          <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
        the iteration count</li>
    </ol>


</dd>
    <dt>
    <a name = "Grid:around"></a>
    <strong>Grid:around&nbsp;(node [, radius])</strong>
    </dt>
    <dd>
    Grid iterator.  Iterates on each node along the outline (border) of a squared area
 centered on the given node.

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">node</span>
        <span class="types"><span class="type">node</span></span>
       a given <code>node</code></li>
      <li><span class="parameter">radius</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the area radius (half-length). Defaults to <strong>1</strong> when not given.</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">
 for node in myGrid:around(node, 2) do
   ...
 end</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><span class="type">node</span></span>
        a <code>node</code> at each iteration step
    </ol>


</dd>
    <dt>
    <a name = "Grid:each"></a>
    <strong>Grid:each&nbsp;(f [, ...])</strong>
    </dt>
    <dd>
    Each transformation.  Calls the given function on each <code>node</code> in the <a href="../modules/grid.html#">grid</a> ,
 passing the <code>node</code> as the first argument to function <strong>f</strong>.

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">f</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">func</a></span>
       a function prototyped as <strong>f(node,...)</strong></li>
      <li><span class="parameter">...</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.5">vararg</a></span>
       args to be passed to function <strong>f</strong></li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">
 local function printNode(node)
   print(node:getX(), node:getY())
 end
 myGrid:each(printNode)</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/grid.html#">grid</a></span>
        self (the calling <a href="../modules/grid.html#">grid</a>  itself, can be chained)
    </ol>


</dd>
    <dt>
    <a name = "Grid:eachRange"></a>
    <strong>Grid:eachRange&nbsp;(lx, ly, ex, ey, f [, ...])</strong>
    </dt>
    <dd>
    Each (in range) transformation.  Calls a function on each <code>node</code> in the range of a rectangle of cells,
 passing the <code>node</code> as the first argument to function <strong>f</strong>.

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">lx</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the leftmost x-coordinate coordinate of the rectangle</li>
      <li><span class="parameter">ly</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the topmost y-coordinate of the rectangle</li>
      <li><span class="parameter">ex</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the rightmost x-coordinate of the rectangle</li>
      <li><span class="parameter">ey</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the bottom-most y-coordinate of the rectangle</li>
      <li><span class="parameter">f</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">func</a></span>
       a function prototyped as <strong>f(node,...)</strong></li>
      <li><span class="parameter">...</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.5">vararg</a></span>
       args to be passed to function <strong>f</strong></li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">
 local function printNode(node)
   print(node:getX(), node:getY())
 end
 myGrid:eachRange(1,1,8,8,printNode)</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/grid.html#">grid</a></span>
        self (the calling <a href="../modules/grid.html#">grid</a>  itself, can be chained)
    </ol>


</dd>
    <dt>
    <a name = "Grid:imap"></a>
    <strong>Grid:imap&nbsp;(f [, ...])</strong>
    </dt>
    <dd>
    Map transformation.
 Calls function <strong>f(node,...)</strong> on each <code>node</code> in a given range, passing the <code>node</code> as the first arg to function <strong>f</strong> and replaces
 it with the returned value. Therefore, the function should return a <code>node</code>.

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">f</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">func</a></span>
       a function prototyped as <strong>f(node,...)</strong></li>
      <li><span class="parameter">...</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.5">vararg</a></span>
       args to be passed to function <strong>f</strong></li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">
 local function nothing(node)
   return node
 end
 myGrid:imap(nothing)</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/grid.html#">grid</a></span>
        self (the calling <a href="../modules/grid.html#">grid</a>  itself, can be chained)
    </ol>


</dd>
    <dt>
    <a name = "Grid:imapRange"></a>
    <strong>Grid:imapRange&nbsp;(lx, ly, ex, ey, f [, ...])</strong>
    </dt>
    <dd>
    Map in range transformation.
 Calls function <strong>f(node,...)</strong> on each <code>node</code> in a rectangle range, passing the <code>node</code> as the first argument to the function and replaces
 it with the returned value. Therefore, the function should return a <code>node</code>.

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">lx</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the leftmost x-coordinate coordinate of the rectangle</li>
      <li><span class="parameter">ly</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the topmost y-coordinate of the rectangle</li>
      <li><span class="parameter">ex</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the rightmost x-coordinate of the rectangle</li>
      <li><span class="parameter">ey</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the bottom-most y-coordinate of the rectangle</li>
      <li><span class="parameter">f</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">func</a></span>
       a function prototyped as <strong>f(node,...)</strong></li>
      <li><span class="parameter">...</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.5">vararg</a></span>
       args to be passed to function <strong>f</strong></li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">
 local function nothing(node)
   return node
 end
 myGrid:imap(1,1,6,6,nothing)</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><a class="type" href="../modules/grid.html#">grid</a></span>
        self (the calling <a href="../modules/grid.html#">grid</a>  itself, can be chained)
    </ol>


</dd>
    <dt>
    <a name = "Grid:getNodeAt"></a>
    <strong>Grid:getNodeAt&nbsp;(x, y)</strong>
    </dt>
    <dd>
    Returns the <code>node</code> at location [x,y].

    <h3>Parameters:</h3>
    <ul>
      <li><span class="parameter">x</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the x-coordinate coordinate</li>
      <li><span class="parameter">y</span>
        <span class="types"><a class="type" href="http://www.lua.org/manual/5.1/manual.html#2.2">int</a></span>
       the y-coordinate coordinate</li>
    </ul>

    <h3>Usage:</h3>
    <ul>
        <pre class="example">local aNode = myGrid:getNodeAt(2,2)</pre>
    </ul>

    <h3>Returns:</h3>
    <ol>

          <span class="types"><span class="type">node</span></span>
        a <code>node</code>
    </ol>


</dd>
</dl>


</div> <!-- id="content" -->
</div> <!-- id="main" -->
<div id="about">
<i>generated by <a href="http://github.com/stevedonovan/LDoc">LDoc 1.2</a></i>
</div> <!-- id="about" -->
</div> <!-- id="container" -->
</body>
</html>
